package com.hotel.app.controller;

import com.hotel.app.service.FoodFeign;
import com.hotel.user.entity.Food;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * --- 年薪百万 ---
 * ---So easy---
 *
 * @author ZhiHuiJun
 * @motto 学习都是人上人
 * @desc 就是很帅很优秀
 * @CC 每天漂亮、幸福、快乐、自由
 */
@RestController
@RequestMapping("/api")
public class FoodController {

    @Autowired
    private FoodFeign foodFeign;

    @GetMapping("/food")
    public List<Food> getAllProducts(@RequestParam(value = "category") String category) {
        return foodFeign.getAllProducts(category);
    }
}
